@model Adams.Admin.DataTransfer.JummahPrayers.Index.PageLoad
@{
    Layout = "~/Views/JummahPrayers/_Layout.cshtml";
}
@section Head{

}
@if (!string.IsNullOrEmpty(ViewBag.Message))
{
    <div class="notification success png_bg">
        <a href="#" class="close">
            <img src="@Url.Content("/Content/images/cross_grey_small.png")" title="Close this notification"
            alt="close" /></a>
        <div>
            @if (ViewBag.Message == "1")
            {
                <b>Successfully saved Jummah Location!</b>
            }
            else if (ViewBag.Message == "2")
            {
                <b>Successfully deleted Jummah Location!</b>
            }
            else if (ViewBag.Message == "3")
            {
                <b>Successfully saved Jummah Prayer!</b>
            }
            else if (ViewBag.Message == "4")
            {
                <b>Successfully deleted Jummah Prayer!</b>
            }
        </div>
    </div>
}
<div class="content-box">
    <!-- Start Content Box -->
    <div class="content-box-header">
        <h3>
            Current Jummah Prayers</h3>
    </div>
    <!-- End .content-box-header -->
    <div class="content-box-content">
        <ul>
            @foreach (var location in Model.Locations)
            {
                <li><b>@location.Name</b> -
                    @location.Street
                    @location.Street2
                    @location.City,
                    @location.State
                    @location.ZipCode 
                    <a href="/JummahPrayers/CreateLocation/@location.ID"><img src="@Url.Content("/Content/images/pencil.png")" alt="Edit" /></a>
                    <a href="javascript:if(confirm('are you sure?')){location.href='/JummahPrayers/DeleteLocation/@location.ID'}"><img src="@Url.Content("/Content/images/cross.png")" alt="delete" /></a>
                    <br />
                    <br />
                    <ul>
                        @foreach (var prayer in location.Prayers)
                        {
                            <li>
                                @prayer.Name
                                -
                                @prayer.Time
                                <a href="/JummahPrayers/CreatePrayer/@prayer.ID"><img src="@Url.Content("/Content/images/pencil.png")" alt="Edit" /></a>
                                <a href="javascript:if(confirm('are you sure?')){location.href='/JummahPrayers/DeletePrayer/@prayer.ID'}"><img src="@Url.Content("/Content/images/cross.png")" alt="delete" /></a></li>
                        }
                        <li><a href="/JummahPrayers/CreatePrayer?LocationID=@location.ID">add prayer</a></li>
                    </ul>
                </li>
            }
        </ul>
    </div>
    <!-- End .content-box-content -->
</div>
<!-- End .content-box -->
@section Scripts {
    <script type="text/javascript" src="@Url.Content("/Scripts/JummahPrayers/index.js")"></script>
}
